package com.fr.cell.editor;

import com.fr.base.Style;
import com.fr.cell.Grid;
import com.fr.report.CellElement;
import com.fr.report.cellElement.TextFormat;
import com.fr.report.core.ReportHelper;
import java.awt.Component;

public class GeneralCellEditor extends TextCellEditor
{
  private CellElement cellElement;

  public Object getCellEditorValue()
    throws Exception
  {
    Object localObject = super.getCellEditorValue();
    Style localStyle = this.cellElement.getStyle();
    if ((localStyle != null) && (localStyle.getFormat() instanceof TextFormat))
      return localObject;
    return ReportHelper.convertGeneralStringAccordingToExcel(localObject);
  }

  public Component getCellEditorComponent(Grid paramGrid, CellElement paramCellElement)
  {
    this.cellElement = paramCellElement;
    return super.getCellEditorComponent(paramGrid, paramCellElement);
  }
}